﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Players
{
    public class Player
    {
        /// <summary>
        /// account name
        /// </summary>
        string strAccount;

        public string StrAccount
        {
            get { return strAccount; }
            set { strAccount = value; }
        }
        /// <summary>
        /// password account
        /// </summary>
        string strPassword;

        public string StrPassword
        {
            get { return strPassword; }
            set { strPassword = value; }
        }
        /// <summary>
        /// full name
        /// </summary>
        string strFullName;

        public string StrFullName
        {
            get { return strFullName; }
            set { strFullName = value; }
        }
        /// <summary>
        /// current money of player
        /// </summary>
        double dMoney;

        public double DMoney
        {
            get { return dMoney; }
            set { dMoney = value; }
        }

        public Player Login(string Account, string Password)
        {
            if (String.IsNullOrEmpty(Account))
            {
                return null;
            }
            if (String.IsNullOrEmpty(Password))
            {
                return null;
            }
            if (Account.Length >= 4 && Password.Length >= 4)
            {
                strAccount = Account;
                strPassword = Password;
                return (Player)this.MemberwiseClone();
            }
            else
            {
                return null;
            }
        }
    }
}
